import { Button } from '@/components/ui/button' import { Reimbursement } from '@/lib/balances' import { Participant } from '@prisma/client' import Link from 'next/link' type Props = { reimbursements: Reimbursement[] participants: Participant[] currency: string groupId: string } export function ReimbursementList({ reimbursements, participants, currency, groupId, }: Props) { const getParticipant = (id: string) => participants.find((p) => p.id === id) return (
{reimbursements.map((reimbursement, index) => (
{getParticipant(reimbursement.from)?.name} owes{' '} {getParticipant(reimbursement.to)?.name}
{currency} {reimbursement.amount.toFixed(2)}
))}
) }